import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import { store } from './redux/store'
import { persistor } from './redux/store';
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/lib/integration/react';



const getClientWidth=()=>{
  const html = document.getElementsByTagName('html')[0]
  html.style.fontSize = (100 / document.documentElement.clientWidth) * 20 + 'vw'
}
// (100 / document.documentElement.clientWidth) * 20    20px下是多少vw
// window.onresize = getClientWidth
// getClientWidth()
window.addEventListener("resize", function () {
  getClientWidth()
});
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <Provider store={store}>
    <PersistGate loading={null} persistor={persistor}>
      <App />
    </PersistGate>
   
  </Provider>
);


